package ezcaptcha

import "github.com/imroc/req/v3"

type TaskTypeRecaptchaV3 string

const (
	TaskTypeReCaptchaV3Proxyless           TaskTypeRecaptchaV3 = "ReCaptchaV3TaskProxyless"
	TaskTypeReCaptchaV3ProxylessS9         TaskTypeRecaptchaV3 = "ReCaptchaV3TaskProxylessS9"
	TaskTypeReCaptchaV3EnterpriseProxyless TaskTypeRecaptchaV3 = "ReCaptchaV3EnterpriseTaskProxyless"
)

// TaskRecaptchaV3C https://ezcaptcha.atlassian.net/wiki/spaces/IS/pages/196965/ReCaptcha+V3
type TaskRecaptchaV3C struct {
	Type         TaskTypeRecaptchaV3 `json:"type"`
	WebsiteURL   string              `json:"websiteURL"`
	WebsiteKey   string              `json:"websiteKey"`
	IsInvisible  bool                `json:"isInvisible,omitempty"`
	PageAction   string              `json:"pageAction,omitempty"`
	WebSiteTitle string              `json:"websiteTitle,omitempty"`
	CheckField   string              `json:"checkField,omitempty"`
	Proxy        string              `json:"proxy,omitempty"`
}

// TaskRecaptchaV3R https://ezcaptcha.atlassian.net/wiki/spaces/IS/pages/196965/ReCaptcha+V3
type TaskRecaptchaV3R struct {
	GRecaptchaResponse string `json:"gRecaptchaResponse"`
}

type (
	ClientRecaptchaV3  = Client[TaskRecaptchaV3C, TaskRecaptchaV3R]
	OptionsRecaptchaV3 = Option[TaskRecaptchaV3C, TaskRecaptchaV3R]
)

func NewClientForRecaptchaV3(httpClient *req.Client, clientKey string, opts ...OptionsRecaptchaV3) *ClientRecaptchaV3 {
	return NewClient(httpClient, clientKey, opts...)
}
